//
//  CustomCollectionCell.m
//  APP_login
//
//  Created by edz on 7/11/21.
//  Copyright © 2021 baicai. All rights reserved.
//
#import <QuartzCore/QuartzCore.h>
#import "CustomCollectionCell.h"
#import "Masonry.h"

@interface CustomCollectionCell ()
@property(nonatomic, strong) UILabel* cellLable;
@end

@implementation CustomCollectionCell
- (id) initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        _cellLable = [[UILabel alloc] init];
        [self addSubview:_cellLable];
        [_cellLable mas_makeConstraints:^(MASConstraintMaker *make){
            make.size.mas_equalTo(CGSizeMake(115, 40));
        }];
        _cellLable.textAlignment = NSTextAlignmentCenter;
        _cellLable.layer.borderColor = [UIColor colorWithRed:230/255.0f green:231/255.0f blue:238/255.0f alpha:1.0f].CGColor;
        _cellLable.layer.borderWidth = 2;
       _cellLable.layer.cornerRadius = 7;
       _cellLable.clipsToBounds = YES;
    }
    return self;
}

- (void)setModel:(TagModel *)model{
    _cellLable.text = model.tagTittle;
    if (model.tagState) {
        _cellLable.backgroundColor = [UIColor colorWithRed:60/255.0f green:141/255.0f blue:251/255.0f alpha:1.0f];
        _cellLable.textColor = [UIColor whiteColor];
    }else{
        _cellLable.backgroundColor = [UIColor whiteColor];
        _cellLable.textColor = [UIColor blackColor];
    }
}
@end
